package shixhun;

import java.util.Scanner;

public class Demo3 {
    public static void main (String[] args){
        String str = "abcdE";
        //最少是五位字母
        String regex = "^[a-zA-Z]{5,}$";
        System.out.println(str.matches(regex));
        //一组统配符 * ？ +
        //一组1-9的数字和一位a-z的组合，组合可以出现任意次数
        str="3d2a4a5e";
        regex = "^[1-9][a-z]*$";
        System.out.println(str.matches(regex));
        str = "1a2v";
        regex = "^([1-8][a-z]+$)";
        System.out.println(str.matches(regex));
        str = "2a2v";
        regex = "^([1-8][a-z]?$)";
        System.out.println(str.matches(regex));
        Scanner input = new Scanner(System.in);
        String ID=input.nextLine();
        String  regex3 = "^[1-9]\\d{5}(\\d{4})(\\d{2})(\\d{2})(\\d{3})([0-9]|X)$";
        System.out.println(ID.matches(regex3));
        String str5 = "1172201942@qq.com";
        String regex4 = "^[a-zA-Z_1-9]\\w{6}+@[a-z]{3,5}+.[a-z]{3}$";
        System.out.println(str5.matches(regex4));
    }
}
